extends "../bailong-2/bailong-2.gd"


func _extInit():
	._extInit()
	if isInManual():
		addSkill(sk2t1[1], sk2t1[0])
		addSkill(sk2t2[1], sk2t2[0])
	elif sk2 != 0:
		doChoiceSkill2()
	lv = 3             #等级的设置

var sk2t1 = ["锋焰显征·1", "每10秒为所有敌人附加5层<烧蚀>，若目标烧蚀达到20层，则对其触发[天雷罪灭](同一个目标5秒内无法连续被审判)"]
var sk2t2 = ["锋焰显征·2", "天雷罪灭造成伤害后若没有击杀目标，40%几率再次发动"]

func doChoiceSkill2():
	if sk2 == 1:
		addSkill("每{cd}秒为所有敌人附加5层<烧蚀>，若目标烧蚀达到20层，则对其触发[天雷罪灭](同一个目标5秒内无法连续被审判)", sk2t1[0], "bailong3", 10)
	if sk2 == 2:
		addSkill("天雷罪灭造成伤害后若没有击杀目标，40%几率再次发动", sk2t2[0])

func _castCdSkill(id):
	._castCdSkill(id)
	if id=="bailong3":
		bailong3()

func bailong3():
	for i in getAllChas(1):
		i.addBuff(buff.b_shaoShi.new(5))
		var bf = i.hasBuff("b_shaoShi")
		if bf.life >= 19:
			tianleizm(i)

func onAtkEnd(atkInfo):
	.onAtkEnd(atkInfo)
	if sk2 == 2 and atkInfo.skill == "天雷罪灭" and not atkInfo.hitCha.isDeath and sys.rndPer(40):
		tianleizm(atkInfo.hitCha)
